//
//  ListController.h
//  pa
//
//  Created by HaiJiao Chen on 12-7-25.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AppDelegate.h"
#import "ListControllerBG.h"

@protocol ListControllerDelegate <NSObject>
- (void)tableView:(UITableView*)table didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
@end

@interface ListController : NSObject<UITableViewDelegate,UITableViewDataSource>
{
    UITableView* tableView;
    id<DataSource> data;
    NSString* reuseIdentifer;
    ListControllerBG* bg;
    int cellHeight;
}
@property (nonatomic, assign) id<ListControllerDelegate> delegate;

-(void)setupController:(UITableView*)tableView data:(id<DataSource>)data reuse:(NSString*)reuse;
-(void)createSubView:(UITableViewCell*)cell;
-(void)setupNewCell:(UITableViewCell*)cell obj:(id<NSObject>)obj indexPath:(NSIndexPath*)indexPath;
- (CGFloat)heightForRowAtIndexPath:(NSIndexPath *)indexPath obj:(id<NSObject>)obj;
- (void)setBGWithColor1:(UIColor*)color1 color2:(UIColor*)color2 height:(int)height bg:(ListControllerBG*)bg;

@end
